// pages/pinglun/pinglun.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    pinlun:'lala',
    order_mun:'',
    hao:1,
    zhong:0,
    cha:0,
    selecet:1,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var order_mun = options.order_id
    var that = this;
    that.setData({
      order_mun: order_mun
    })
    wx.request({
      url: 'https://wukongweixiu.cn/index/Order/getpinglun',
      data: {
        order_mun: that.data.order_mun,
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      method: 'GET',
      success: function (res) {
        that.setData({
          pinlun: res.data.data.data.pinglun,
          selecet: res.data.data.data.selecet
        })

      },
      fail: function (res) { },
      complete: function (res) { }
    });


  },
  neirong:function(e){
    var that = this
    that.setData({
      pinlun: e.detail.value
    })
  },
  haoping:function(e){
    var that = this;
    var select = e.currentTarget.dataset.id;
    if (select == 'hao'){
      that.setData({
        hao: 1,
        zhong: 0,
        cha: 0,
        selecet: 1
      })
    } else if (select == 'zhong'){
      that.setData({
        hao: 0,
        zhong: 1,
        cha: 0,
        selecet: 2
      })
    } else if (select == 'cha'){
      that.setData({
        hao: 0,
        zhong: 0,
        cha: 1,
        selecet: 3
      })
    }
    
  },
  pinglun:function(){
    var that = this;
    var pinlun = that.data.pinlun;
    wx.request({
      
      url: 'https://wukongweixiu.cn/index/Order/pinglun',
      data: {
        pinlun: that.data.pinlun,
        selecet: that.data.selecet,
        order_mun: that.data.order_mun,
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      method: 'GET',
      success: function (res) {
        

      },
      fail: function (res) { },
      complete: function (res) { }
    });
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})